﻿using System;
using System.IO;
using System.Xml.Serialization;

namespace Utility.Xml
{
	// Token: 0x0200065B RID: 1627
	public class Seializer
	{
		// Token: 0x060026A8 RID: 9896 RVA: 0x00148560 File Offset: 0x00146760
		public static T Seialize<T>(string filename, T data)
		{
			using (FileStream fileStream = new FileStream(filename, FileMode.Create))
			{
				XmlSerializer xmlSerializer = new XmlSerializer(typeof(T));
				xmlSerializer.Serialize(fileStream, data);
			}
			return data;
		}

		// Token: 0x060026A9 RID: 9897 RVA: 0x001485B8 File Offset: 0x001467B8
		public static T Deserialize<T>(string filename)
		{
			T result;
			using (FileStream fileStream = new FileStream(filename, FileMode.Open))
			{
				XmlSerializer xmlSerializer = new XmlSerializer(typeof(T));
				result = (T)((object)xmlSerializer.Deserialize(fileStream));
			}
			return result;
		}
	}
}
